package com.qfjy.homework.liziheng;

public class ComputerFactory {

    // 使用buyComputer方法获取任意品牌电脑
    public Computer buyComputer(String computerName){
        if (computerName == null){
            return null;
        }
        if (computerName.equalsIgnoreCase("LENOVO")){
            return new Lenovo();
        } else if (computerName.equalsIgnoreCase("DELL")){
            return new Dell();
        } else if (computerName.equalsIgnoreCase("HASEE")){
            return new Hasee();
        }
        return null;
    }
}
